﻿@model Model.AppUserList
@{
    ViewBag.Title = "ActionType";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@using Model

@section JQscriptSection{
    <script type="text/javascript">
        $(document).ready(function () {
            var curr_time = new Date();
            var strDate = curr_time.getFullYear() + "-";
            strDate += curr_time.getMonth() + 1 + "-";
            strDate += curr_time.getDate();
            $("#StartDate").datebox("setValue", strDate);
            $("#EndDate").datebox("setValue", strDate);
            InitGrid();
        });

        HandleDom.ClassTriggerClick("icon-add", function () {
            $('#hiddenLOCATIONID').val();
            HandleDialog.OpenDialogByAdd('dlg', '添加日志类型', function () {
                HandleData.ClearForm('location');
                $('#locationCode').focus();
                $('#locationCode').attr("readonly", false);
                $('#txtGoodsCode').attr("readonly", false);

                $('#valids').combobox('setValue', '0');

            });
        });

        function saveData(isClose) {
            HandleRequest.submitForm('location', '@Url.Action("SaveData", "ActionType")', function (data) {
                eval('data=' + data);
                if (data.success == true) {
                    layer.alert('执行成功!', 9);
                    InitGrid();
                    HandleDialog.CloseDialog('dlg');
                } else {
                    layer.msg(data.msg, 1);
                }

            });
        }

        function InitGrid() {
            var typeName = $('#typeName').val();
            var startDate = $('#StartDate').datebox('getValue');
            var endDate = $('#EndDate').datebox('getValue');

            queryParams = {
                typeName: typeName,
                startDate: startDate,
                endDate: endDate
            }
            HandleData.InitDataGrid('dg', '/ActionType/InitJsonResult', 'toolbar', queryParams, 'ATID', true, function (data) { },
                function (rowIndex, rowData) {//双击
                    edit(rowData);
                });
        }
    </script>
}

<body style="background-color: ButtonFace; font-size: 17px">
    <div class="easyui-panel" title="查询条件" style="height: 130px; padding: 5px; background: #fafafa; width: 1700px;">
        <form id="query" method="post">
            <table>
                <tr>
                    <td>模块名称:
                    </td>
                    <td>
                        <input id="typeName" name="typeName" style="width: 154px" />
                    </td>
                    <td>创建时间:
                    </td>
                    <td>
                        <input class="easyui-datebox" id="StartDate" name="StartDate" style="width: 140px;" />
                    </td>
                    <td>~：
                    </td>
                    <td>
                        <input class="easyui-datebox" id="EndDate" name="EndDate" style="width: 140px;" validtype="compareDate['#StartDate']" />
                    </td>
                    <td></td>
                    <td>
                        <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">查询</a>
                    </td>

                </tr>
            </table>
        </form>

    </div>
    <div style="min-height: 720px; width: 1700px;">
        <table id="dg" title="日志类型信息" style="min-height: 600px;">
            <thead>
                <tr>
                    <th data-options="field:'ATID',width:30">ID</th>
                    <th data-options="field:'PROJECTNAME',width:30">项目</th>
                    <th data-options="field:'TYPECODE',width:50">类型编号</th>
                    <th data-options="field:'TYPENAME',width:50">日志类型</th>
                    <th data-options="field:'USERNAME',width:50">创建人</th>
                    <th data-options="field:'CREATEDATE',width:50">创建时间</th>
                </tr>
            </thead>
        </table>
    </div>
    <div id="dlg" class="easyui-dialog" style="width: 320px; height: 150px; top: 300px; left: 400px; padding: 2px"
        data-options="closed:true,buttons:'#dlg-buttons',modal:true">
        <form id="location" method="post">
            <table>
                <tr>
                    <td>类型编号:
                    </td>
                    <td>
                        <input id="typeCode" name="typeCode" style="width: 154px" class="easyui-validatebox" data-options="required:true" validtype="integer['#typeCode']" />
                    </td>

                </tr>
                <tr>
                    <td>项目:
                    </td>
                    <td>
                        <input id="projectName" name="projectName" style="width: 154px" class="easyui-validatebox" data-options="required:true" />
                    </td>

                </tr>
                <tr>
                    <td>日志类型:
                    </td>
                    <td colspan="2">
                        <input id="stypeName" name="stypeName" class="easyui-validatebox" style="width: 154px" data-options="required:true" />
                    </td>
                </tr>

                <tr>
                    <td colspan="5">
                        <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="saveData(true)">保存</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    @Html.Partial("~/Views/Shared/_PartialToolbar.cshtml", new Toolbar
{
    GridName = "dg",
    GridType = "datagrid",
    ToolbarName = "toolbar",
    FunctionModule = new Dictionary<string, List<FunctionModule>>()
    {
        {"Function",new List<FunctionModule>()
            {
              new FunctionModule(){Name = "Add",IsEnable =true },
              new FunctionModule(){Name = "Edit",IsEnable =false },
              new FunctionModule(){Name = "Remove",IsEnable =false },
              new FunctionModule(){Name = "Reload",IsEnable =false },
              new FunctionModule(){Name = "Collapse",IsEnable =false },
              new FunctionModule(){Name = "Exporter",IsEnable =false },
              
            }
        }
    }
})

</body>

